package com.stronger.pettern.proxy;

/**
 * 代理
 */
public class AgentProxy implements ProxyInterface{

    private Tenant tenant;
    private String name;

    public AgentProxy (String name){
        this.name=name;
    }
    @Override
    public void buy() {
        if (tenant==null) {
            tenant=new Tenant(name);
        }
        tenant.buy();
    }
}
